import axios from 'axios'
const api = process.env.API_ROOT
let instance = axios.create({
  baseURL: api,
  timeout: 30000,
  headers: {'content-type': 'application/x-www-form-urlencoded'}
})
// instance.interceptors.request.use((config) => {


//   // 挂载 axios 拦截器  给请求头挂载一个字段来验证token
//   config.headers.Authorization = window.localStorage.getItem('token')

//     return config;
// }, (error) => {
//   return Promise.reject(error);
// })
instance.interceptors.response.use((res) => {
  if(res.status === 200){
    return res
  }
})
export default instance
